package android.support.v4.app;

import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.c.a;
import android.util.SparseArray;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View;
import android.view.View.OnCreateContextMenuListener;
import android.view.ViewGroup;
import android.view.animation.Animation;
import java.util.HashMap;

public final class Fragment
  implements ComponentCallbacks, View.OnCreateContextMenuListener
{
  private static final HashMap P = new HashMap();
  boolean A;
  boolean B;
  boolean C;
  boolean D;
  boolean E = true;
  boolean F;
  int G;
  ViewGroup H;
  View I;
  View J;
  boolean K;
  boolean L = true;
  w M;
  boolean N;
  boolean O;
  int a = 0;
  View b;
  int c;
  Bundle d;
  SparseArray e;
  int f = -1;
  String g;
  Bundle h;
  Fragment i;
  int j = -1;
  int k;
  boolean l;
  boolean m;
  boolean n;
  boolean o;
  boolean p;
  boolean q;
  int r;
  m s;
  FragmentActivity t;
  m u;
  Fragment v;
  int w;
  int x;
  String y;
  boolean z;

  public static Fragment a(Context paramContext, String paramString)
  {
    return a(paramContext, paramString, null);
  }

  public static Fragment a(Context paramContext, String paramString, Bundle paramBundle)
  {
    try
    {
      Class localClass2 = (Class)P.get(paramString);
      Class localClass1 = localClass2;
      if (localClass2 == null)
      {
        localClass1 = paramContext.getClassLoader().loadClass(paramString);
        P.put(paramString, localClass1);
      }
      paramContext = (Fragment)localClass1.newInstance();
      if (paramBundle != null)
      {
        paramBundle.setClassLoader(paramContext.getClass().getClassLoader());
        paramContext.h = paramBundle;
      }
      return paramContext;
    }
    catch (java.lang.ClassNotFoundException paramContext)
    {
      throw new e("Unable to instantiate fragment " + paramString + ": make sure class name exists, is public, and has an empty constructor that is public", paramContext);
    }
    catch (java.lang.InstantiationException paramContext)
    {
      throw new e("Unable to instantiate fragment " + paramString + ": make sure class name exists, is public, and has an empty constructor that is public", paramContext);
    }
    catch (java.lang.IllegalAccessException paramContext)
    {
      throw new e("Unable to instantiate fragment " + paramString + ": make sure class name exists, is public, and has an empty constructor that is public", paramContext);
    }
  }

  public static void a()
  {
  }

  public static void b()
  {
  }

  public static Animation c()
  {
    return null;
  }

  public static void d()
  {
  }

  public static void e()
  {
  }

  final void a(int paramInt, Fragment paramFragment)
  {
    this.f = paramInt;
    if (paramFragment != null)
    {
      this.g = paramFragment.g + ":" + this.f;
      return;
    }
    this.g = "android:fragment:" + this.f;
  }

  public final boolean equals(Object paramObject)
  {
    return super.equals(paramObject);
  }

  final View f()
  {
    if (this.u != null)
      this.u.s = false;
    return null;
  }

  final void g()
  {
    if (this.u != null)
    {
      this.u.s = false;
      this.u.d();
    }
    this.F = false;
    this.F = true;
    if (!(this.N))
    {
      this.N = true;
      if (!(this.O))
      {
        this.O = true;
        this.M = this.t.b(this.g);
      }
      if (this.M != null)
        this.M.b();
    }
    if (!(this.F))
      throw new z("Fragment " + this + " did not call through to super.onStart()");
    if (this.u != null)
      this.u.i();
    if (this.M == null)
      return;
    this.M.f();
  }

  final void h()
  {
    if (this.u != null)
      this.u.a(2);
    if (this.N)
    {
      this.N = false;
      if (!(this.O))
      {
        this.O = true;
        this.M = this.t.b(this.g);
      }
      if (this.M != null)
      {
        if (this.t.h)
          break label79;
        this.M.c();
      }
    }
    return;
    label79: this.M.d();
  }

  public final int hashCode()
  {
    return super.hashCode();
  }

  final void i()
  {
    if (this.u != null)
      this.u.l();
    this.F = false;
    this.F = true;
    if (!(this.O))
    {
      this.O = true;
      this.M = this.t.b(this.g);
    }
    if (this.M != null)
      this.M.g();
    if (this.F)
      return;
    throw new z("Fragment " + this + " did not call through to super.onDestroy()");
  }

  public final void onConfigurationChanged(Configuration paramConfiguration)
  {
    this.F = true;
  }

  public final void onCreateContextMenu(ContextMenu paramContextMenu, View paramView, ContextMenu.ContextMenuInfo paramContextMenuInfo)
  {
    this.t.onCreateContextMenu(paramContextMenu, paramView, paramContextMenuInfo);
  }

  public final void onLowMemory()
  {
    this.F = true;
  }

  public final String toString()
  {
    StringBuilder localStringBuilder = new StringBuilder(128);
    a.a(this, localStringBuilder);
    if (this.f >= 0)
    {
      localStringBuilder.append(" #");
      localStringBuilder.append(this.f);
    }
    if (this.w != 0)
    {
      localStringBuilder.append(" id=0x");
      localStringBuilder.append(Integer.toHexString(this.w));
    }
    if (this.y != null)
    {
      localStringBuilder.append(" ");
      localStringBuilder.append(this.y);
    }
    localStringBuilder.append('}');
    return localStringBuilder.toString();
  }
}